Skip to content

Add gemini support#4

Open
Utakata wants to merge 5 commits intoechohive42:mainfrom
Utakata:add-gemini-support
Open

Add gemini support#4
Utakata wants to merge 5 commits intoechohive42:mainfrom
Utakata:add-gemini-support

Conversation

@Utakata
Copy link

@Utakata Utakata commented Jan 6, 2025

This PR adds support for Google's Gemini API alongside the existing OpenAI GPT implementation, with special focus on Japanese language support.

Added features:

  • Support for Google Gemini Pro API
  • Japanese language support for PDF analysis
  • Separate scripts for English and Japanese processing
  • Updated documentation in both English and Japanese

New files:

  • pdf_reader_gemini.py: English version using Gemini API
  • pdf_reader_gemini_ja.py: Japanese optimized version using Gemini API
  • README_ja.md: Japanese documentation
  • .env.example: Updated with Gemini API key example

Changes:

  • Added new dependencies in requirements.txt
  • Updated main README with Gemini API information
  • Added documentation about API choice considerations

Benefits of this addition:

  1. Alternative AI model choice for users
  2. Better Japanese text processing capabilities
  3. Cost-effective option compared to OpenAI GPT
  4. Improved documentation for Japanese users

Testing:

The implementation has been tested with both English and Japanese PDFs, confirming:

  • Proper text extraction
  • Accurate analysis and summarization
  • Correct handling of Japanese characters
  • Proper JSON output encoding

Setup required:

Users need to:

  1. Install new dependencies (google-generativeai)
  2. Set up Gemini API key in .env
  3. Choose appropriate script based on language needs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant